<template>
	<div class="detail-container">
		<el-row >
      <el-col :span="16">
        <el-row :gutter="20">
          <el-col :span="12">
            经销商类型
            <span class="detail-value">{{DealerType[detailData.type]}}</span>
          </el-col>
          <el-col :span="12">
            经销商名称
            <span class="detail-value">{{detailData.name}}</span>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            经销商层级
            <span class="detail-value">{{DealerLevel[detailData.level]}}</span>
          </el-col>
          <el-col :span="12">
            联系人
            <span class="detail-value">{{detailData.contact}}</span>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            联系电话
            <span class="detail-value">{{detailData.phone}}</span>
          </el-col>
          <el-col :span="12">
            状态
            <span class="detail-value">{{ALL_STATUS[detailData.status]}}</span>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="8" style="text-align: center;">
        <div style="width: 60px; height: 60px; border-radius: 50%;overflow: hidden; margin: 20px auto 0 auto;">
          <img :src="detailData.icon" style="width: 100%; height: 100%;" >
        </div>
        <h6 class="mt-20">{{detailData.name}}</h6>
        <el-row>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">{{detailData.partnerAmount}}</span><br/>
            团队成员
          </el-col>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">{{detailData.saleAmount}}</span><br/>
            累计销售
          </el-col>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">￥{{detailData.commissionAmount}}</span><br/>
            累计佣金
          </el-col>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">￥{{detailData.withdrawAmount}}</span><br/>
            累计提现额
          </el-col>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">￥{{detailData.balance || 0}}</span><br/>
            账户余额
          </el-col>
          <el-col class="mt-20" :span="12">
            <span class="detail-value">￥{{detailData.unsettled}}</span><br/>
            未结算佣金
          </el-col>
        </el-row>
      </el-col>
    </el-row>
	</div>
</template>

<script>
import {dealerProfile} from '@/api/dealerMgt'
import { DealerType, ALL_STATUS, DealerLevel } from "@/utils/const";

export default {
  name: "basicInfo",
  props: ['id'],
	data() {
    this.DealerType = DealerType
    this.ALL_STATUS = ALL_STATUS
    this.DealerLevel = DealerLevel

		return {
			detailData: {}
		};
  },
  methods: {
    async requestInfo() {
      const {data} = await dealerProfile(this.id)
      this.detailData = data
    }
  },
  created() {
    this.requestInfo();
  }
};
</script>

<style scoped lang="scss">
</style>
